package com.zy.reflect.proxy;

/**
 * @Author Gong
 * @Description
 * @dATE 2021/12/21 10:46
 **/
public class ProxyFactory implements ClothFactory{
    private ClothFactory cf;
    //创建代理类的对象的时候，实际上传递的是被代理类的对象
    public ProxyFactory(ClothFactory cf){
        this.cf=cf;
    }
    @Override
    public void clothProduct(String brand) {
        System.out.println("代理类开始代理---");
        cf.clothProduct(brand);
        System.out.println("代理类代理完毕---");
    }

    public static void main(String[] args) {
        AdidasClothFactory adidas=new AdidasClothFactory();
        ProxyFactory proxy=new ProxyFactory(adidas);
        proxy.clothProduct("xxx品牌");

    }
}
